<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/5/12 0012
 * Time: 16:52
 */

namespace app\common\model;


class Dadacity extends BaseModel
{
    const is_prepay_0 = 0;  //是否需要垫付 1:是 0:否 (垫付订单金额，非运费)
    const is_prepay_1 = 1;

    /**
     * @param $data
     * 通过循环编号保存达达城市信息
     */
    public function insterCitys($data){
        foreach ($data as $item){
            self::insert([
                'cityName'=> $item['cityName'],
                'cityCode'=> $item['cityCode'],
            ]);
        }
    }

    public function getCity($cityName){
        return self::where('cityName',"=",$cityName)->find();
    }


}